function talcoord = cvc_dipfit2tal(EEG,comps)
% DIPFIT2TAL
%
%  Synopsis
%  ========
%
%  talcoord = cvc_dipfit2tal(EEG,comps)
%
%  -- Author: Mads Dyrholm --
%     Center for Visual Cognition, University of Copenhagen.
%     April 2011
%
%  Purpose
%  =======
%  
%  REturn dipole location Talairach coodinates.
%
%  Inputs
%  ======
%
%  comps - List of ICA component indices.

talcoord = [];

for talcomps = comps
  %pop_dipplot( EEG,talcomps, 'mri', '/home/mads/professor/Copenhagen/lib/eeglab8_0_3_1b/plugins/dipfit2.2/standard_BESA/avg152t1.mat', 'normlen', 'on');
  [sources X Y Z XE YE ZE] = dipplot( EEG.dipfit.model(talcomps), 'mri', EEG.dipfit.mrifile, 'normlen', 'on','coordformat','Spherical','plot','off');
  talcoord = cat(1,talcoord,sources.talcoord);
end
